import java.util.*;

class Customer implements Comparable<Customer>{
    int id;
    int serviceTime;

    public Customer(int id, int serviceTime) {
        this.id = id;
        this.serviceTime = serviceTime;
    }


    @Override
    public int compareTo(Customer o) {
        return this.serviceTime - o.serviceTime;
    }
}

public class Test3 {

    public static double calculateAverageWaitTime(List<Customer> customers) {
        Collections.sort(customers);


        int waitTime = 0;
        int totalWaitTime = 0;

        for (Customer customer : customers) {
            waitTime += customer.serviceTime;
            totalWaitTime += waitTime;
        }

        return (double) totalWaitTime / customers.size();
    }

    public static void main(String[] args) {
        List<Customer> customers = new ArrayList<>();
        customers.add(new Customer(1, 56));
        customers.add(new Customer(2, 12));
        customers.add(new Customer(3, 1));
        customers.add(new Customer(4, 99));
        customers.add(new Customer(5, 1000));
        customers.add(new Customer(6, 234));
        customers.add(new Customer(7, 33));
        customers.add(new Customer(8, 55));
        customers.add(new Customer(9, 99));
        customers.add(new Customer(10, 812));
        double averageWaitTime = calculateAverageWaitTime(customers);

        System.out.println("Average Wait Time: " + averageWaitTime);
    }
}
